<?php
/**
 * Created by b17
 * 2/17/12 8:51 PM
 */

class VoteController extends G4T_Controller
{
    public function voteAction()
    {
        $marksManager = new \Managers\Marks();
//        if ($this->_request->isPost()) {
            $news = $this->_getParam('news');
            $ip = $_SERVER['REMOTE_ADDR'];
            if ($marksManager->canVote($news, $ip)) {
                $marksManager->vote($news, $ip, $this->_getParam('mark'));
            } else {

            }
//        }
        $this->renderScript('/ajax/json.phtml');
    }
}
